﻿internal static class Extends
{
    public static ITypeSymbol GetSampleType(this Compilation compilation, INamedTypeSymbol type)
    {
        var count = type.TypeArguments.Length;
        var ts = compilation.GetSpecialTypes(count);

        if (type.IsUnboundGenericType)
            type = type.OriginalDefinition;

        return type.Construct([.. ts]);
    }

    private static IEnumerable<ITypeSymbol> GetSpecialTypes(this Compilation compilation, int count)
    {
        for (int i = 1; i <= count; i++)
        {
            var e = (SpecialType)i;
            yield return compilation.GetSpecialType(e);
        }
    }
}